package com.pxxy.mall.product.config;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author zhangjj
 * @since 2024/1/18
 */
@Configuration
public class MyRedissonConfig {
    @Bean
    public RedissonClient redissonClient() {
        Config config = new Config();
        config.useSingleServer()  //的那节点模式
                .setAddress("redis://192.168.10.133:6379");
        //根据Config创建出RedissonClient实例
        return Redisson.create(config);
    }


}
